home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1997 January / Macworld (1997-01).dmg / Shareware World / Maths & Science / Interpolation Tools v1.1 / Calling from VB… next >
Text File  |  1996-10-10  |  324b  |  21 lines

  1. To call an excel macro from Visual Basic, do something like the following:
  2.  
  3.  
  4. Function dostuff()
  5.  
  6. Dim Pts(1, 4) As Double
  7. Pts(0, 0) = 1
  8. Pts(1, 0) = 1
  9. Pts(0, 1) = 2
  10. Pts(1, 1) = 2
  11. Pts(0, 2) = 3
  12. Pts(1, 2) = 4
  13. Pts(0, 3) = 4
  14. Pts(1, 3) = 8
  15. Pts(0, 4) = 5
  16. Pts(1, 4) = 16
  17.  
  18.  
  19. dostuff = Run("Linear_Interpolate", 3.21, Pts)
  20.  
  21. End Function